package com.iplant.wms.service.po.mfs;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.base.utils.annotation.join.multi.DBJoinMulti;
import com.iplant.base.utils.annotation.po.DBBasePO;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

;

/**
 * 库位
 *
 * @author ShrisJava
 */
@DBBasePO(TableName = "wms_store_station", CheckName = {"Code", "StoreID,StoreRegionID,StoreAreaID,Name"},
        Schemas = DBSchemas.WMS, CodeAuto = true, CodePrefix = "KW-",Cache = true)
public class WMSStoreStation extends BasePO implements Serializable {
    private static final long serialVersionUID = 1L;

    @DBCondition(CompareType = DBCondition.DBCompareType.findInSet)
    @DBJoin(name = "FactoryIDList", tableName = "wms_store", tableAsName = "r2", Schemas = DBSchemas.WMS,
            MainTableField = "StoreID")
    public List<Integer> FactoryIDList = new ArrayList<>();


    @DBJoinMulti(Name = "Code", TableName = "fmc_factory", MainTableField = "FactoryIDList", Schemas = DBSchemas.Basic)
    public String FactoryCode = "";

    @DBJoinMulti(Name = "Name", TableName = "fmc_factory", MainTableField = "FactoryIDList", Schemas = DBSchemas.Basic)
    public String FactoryName = "";

    @DBCondition
    @DBField
    public int StoreID = 0;

    @DBCondition
    @DBJoin(name = "Code", tableName = "wms_store", tableAsName = "r2", Schemas = DBSchemas.WMS,
            MainTableField = "StoreID")
    public String StoreCode = "";

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Name", tableName = "wms_store", tableAsName = "r2", Schemas = DBSchemas.WMS,
            MainTableField = "StoreID")
    public String StoreName = "";

    @DBCondition
    @DBField
    public int StoreRegionID = 0;

    @DBCondition
    @DBJoin(name = "Code", tableName = "wms_store_region", tableAsName = "r1", JoinIndex = 2, Schemas = DBSchemas.WMS,
            MainTableField = "StoreRegionID")
    public String StoreRegionCode = "";

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Name", tableName = "wms_store_region", tableAsName = "r1", JoinIndex = 2, Schemas = DBSchemas.WMS,
            MainTableField = "StoreRegionID")
    public String StoreRegionName = "";


    @DBCondition
    @DBField
    public int StoreAreaID = 0;

    @DBCondition
    @DBJoin(name = "Code", tableName = "wms_store_area", tableAsName = "r3", JoinIndex = 2, Schemas = DBSchemas.WMS,
            MainTableField = "StoreAreaID")
    public String StoreAreaCode = "";

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Name", tableName = "wms_store_area", tableAsName = "r3", JoinIndex = 2, Schemas = DBSchemas.WMS,
            MainTableField = "StoreAreaID")
    public String StoreAreaName = "";


    /**
     * 库位类型
     */
    @DBCondition
    @DBField
    public int TypeID = 0;

    public String TypeName = "";

    @DBField
    public int RowNumber = 0;

    @DBField
    public int ColumnNumber = 0;


    /**
     * 体积限制
     */
    @DBField
    public int StationVolNumber = 0;

    /**
     * 重量限制
     */
    @DBField
    public int StationWeightNumber = 0;

    /**
     * 箱数限制
     */
    @DBField
    public int StationPackNumber = 0;

    /**
     * 数量限制
     */
    @DBField
    public int StationCPFRNumber = 0;

    /**
     * 托盘限制
     */
    @DBField
    public int StationTrayNumber = 0;


    @DBCondition
    @DBField
    public int StoreShelfID = 0;

    @DBCondition
    @DBJoin(name = "Code", tableName = "wms_store_shelf", tableAsName = "r4", JoinIndex = 2, Schemas = DBSchemas.WMS,
            MainTableField = "StoreShelfID")
    public String StoreShelfCode = "";

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Name", tableName = "wms_store_area", tableAsName = "r4", JoinIndex = 2, Schemas = DBSchemas.WMS,
            MainTableField = "StoreShelfID")
    public String StoreShelfName = "";


    /**
     * 承重
     */
    @DBField
    public double Bearing = 0;

    /**
     * 行号
     */
    @DBField
    public int RowNo = 1;

    /**
     * 列号
     */
    @DBField
    public int ColumnNo = 1;

    /**
     * 深度  默认只有1与2 代表正反面
     */
    @DBField
    public int DepthNo = 1;

    @DBField
    public double Length = 0;

    @DBField
    public double Width = 0;

    @DBField
    public double Height = 0;

    /**
     * 推盘数量限制 <=0 不限制
     */
    @DBField
    public int TrayNumber = 0;

    /**
     * 箱数数量限制 <=0 不限制
     */
    @DBField
    public int BoxNumber = 0;

    /**
     * 最小包装个数数量限制 <=0 不限制
     */
    @DBField
    public int MinPackingNumber = 0;

    /**
     * 不同物料混放  1
     * 不同物料组可以混放 2
     * 所有物料可以混放 3
     */
    @DBField
    public int MixMaterial = 0;


    /**
     * 不同批次可以混放
     */
    @DBField
    public int MixBatch = 1;

    /**
     * 容器模式 1不需要容器 2需要容器
     */
    @DBField
    public int ContainerMode = 1;


    /**
     * 1 箱 2件  3箱|件 4箱&件
     */
    @DBField
    public int PickingMode = 3;

    @DBField
    public double PositionX = 0.0;
    @DBField
    public double PositionY = 0.0;
    @DBField
    public double PositionZ = 0.0;


    /**
     * 整箱补货来源  用于给拣货区整箱补货  存储区不允许
     */
    @DBCondition
    @DBField
    public int PackSourceCPFR = 0;

    /**
     * 拆零补货来源  用于给拣货区拆零补货
     * 存储区不允许拆零补货时，允许整箱补货 即不允许存储零散物料
     * 都不允许时 则不能拣货 如废品，退货物料  可以后续通过流程处理这部分物料
     */
    @DBCondition
    @DBField
    public int PieceSourceCPFR = 0;


    @JsonProperty("FactoryIDList")
    public List<Integer> getFactoryIDList() {
        return FactoryIDList;
    }

    public void setFactoryIDList(List<Integer> factoryIDList) {
        FactoryIDList = factoryIDList;
    }

    @JsonProperty("FactoryCode")
    public String getFactoryCode() {
        return FactoryCode;
    }

    public void setFactoryCode(String factoryCode) {
        FactoryCode = factoryCode;
    }

    @JsonProperty("FactoryName")
    public String getFactoryName() {
        return FactoryName;
    }

    public void setFactoryName(String factoryName) {
        FactoryName = factoryName;
    }

    @JsonProperty("StoreID")
    public int getStoreID() {
        return StoreID;
    }

    public void setStoreID(int storeID) {
        StoreID = storeID;
    }

    @JsonProperty("StoreCode")
    public String getStoreCode() {
        return StoreCode;
    }

    public void setStoreCode(String storeCode) {
        StoreCode = storeCode;
    }

    @JsonProperty("StoreName")
    public String getStoreName() {
        return StoreName;
    }

    public void setStoreName(String storeName) {
        StoreName = storeName;
    }

    @JsonProperty("StoreRegionID")
    public int getStoreRegionID() {
        return StoreRegionID;
    }

    public void setStoreRegionID(int storeRegionID) {
        StoreRegionID = storeRegionID;
    }

    @JsonProperty("StoreRegionCode")
    public String getStoreRegionCode() {
        return StoreRegionCode;
    }

    public void setStoreRegionCode(String storeRegionCode) {
        StoreRegionCode = storeRegionCode;
    }

    @JsonProperty("StoreRegionName")
    public String getStoreRegionName() {
        return StoreRegionName;
    }

    public void setStoreRegionName(String storeRegionName) {
        StoreRegionName = storeRegionName;
    }

    @JsonProperty("StoreAreaID")
    public int getStoreAreaID() {
        return StoreAreaID;
    }

    public void setStoreAreaID(int storeAreaID) {
        StoreAreaID = storeAreaID;
    }

    @JsonProperty("StoreAreaCode")
    public String getStoreAreaCode() {
        return StoreAreaCode;
    }

    public void setStoreAreaCode(String storeAreaCode) {
        StoreAreaCode = storeAreaCode;
    }

    @JsonProperty("StoreAreaName")
    public String getStoreAreaName() {
        return StoreAreaName;
    }

    public void setStoreAreaName(String storeAreaName) {
        StoreAreaName = storeAreaName;
    }

    @JsonProperty("TypeID")
    public int getTypeID() {
        return TypeID;
    }

    public void setTypeID(int typeID) {
        TypeID = typeID;
    }

    @JsonProperty("TypeName")
    public String getTypeName() {
        return TypeName;
    }

    public void setTypeName(String typeName) {
        TypeName = typeName;
    }

    @JsonProperty("RowNumber")
    public int getRowNumber() {
        return RowNumber;
    }

    public void setRowNumber(int rowNumber) {
        RowNumber = rowNumber;
    }

    @JsonProperty("ColumnNumber")
    public int getColumnNumber() {
        return ColumnNumber;
    }

    public void setColumnNumber(int columnNumber) {
        ColumnNumber = columnNumber;
    }

    @JsonProperty("StationVolNumber")
    public int getStationVolNumber() {
        return StationVolNumber;
    }

    public void setStationVolNumber(int stationVolNumber) {
        StationVolNumber = stationVolNumber;
    }

    @JsonProperty("StationWeightNumber")
    public int getStationWeightNumber() {
        return StationWeightNumber;
    }

    public void setStationWeightNumber(int stationWeightNumber) {
        StationWeightNumber = stationWeightNumber;
    }

    @JsonProperty("StationPackNumber")
    public int getStationPackNumber() {
        return StationPackNumber;
    }

    public void setStationPackNumber(int stationPackNumber) {
        StationPackNumber = stationPackNumber;
    }

    @JsonProperty("StationCPFRNumber")
    public int getStationCPFRNumber() {
        return StationCPFRNumber;
    }

    public void setStationCPFRNumber(int stationCPFRNumber) {
        StationCPFRNumber = stationCPFRNumber;
    }

    @JsonProperty("StationTrayNumber")
    public int getStationTrayNumber() {
        return StationTrayNumber;
    }

    public void setStationTrayNumber(int stationTrayNumber) {
        StationTrayNumber = stationTrayNumber;
    }

    @JsonProperty("StoreShelfID")
    public int getStoreShelfID() {
        return StoreShelfID;
    }

    public void setStoreShelfID(int storeShelfID) {
        StoreShelfID = storeShelfID;
    }

    @JsonProperty("StoreShelfCode")
    public String getStoreShelfCode() {
        return StoreShelfCode;
    }

    public void setStoreShelfCode(String storeShelfCode) {
        StoreShelfCode = storeShelfCode;
    }

    @JsonProperty("StoreShelfName")
    public String getStoreShelfName() {
        return StoreShelfName;
    }

    public void setStoreShelfName(String storeShelfName) {
        StoreShelfName = storeShelfName;
    }

    @JsonProperty("Bearing")
    public double getBearing() {
        return Bearing;
    }

    public void setBearing(double bearing) {
        Bearing = bearing;
    }

    @JsonProperty("RowNo")
    public int getRowNo() {
        return RowNo;
    }

    public void setRowNo(int rowNo) {
        RowNo = rowNo;
    }

    @JsonProperty("ColumnNo")
    public int getColumnNo() {
        return ColumnNo;
    }

    public void setColumnNo(int columnNo) {
        ColumnNo = columnNo;
    }

    @JsonProperty("DepthNo")
    public int getDepthNo() {
        return DepthNo;
    }

    public void setDepthNo(int depthNo) {
        DepthNo = depthNo;
    }

    @JsonProperty("Length")
    public double getLength() {
        return Length;
    }

    public void setLength(double length) {
        Length = length;
    }

    @JsonProperty("Width")
    public double getWidth() {
        return Width;
    }

    public void setWidth(double width) {
        Width = width;
    }

    @JsonProperty("Height")
    public double getHeight() {
        return Height;
    }

    public void setHeight(double height) {
        Height = height;
    }

    @JsonProperty("TrayNumber")
    public int getTrayNumber() {
        return TrayNumber;
    }

    public void setTrayNumber(int trayNumber) {
        TrayNumber = trayNumber;
    }

    @JsonProperty("BoxNumber")
    public int getBoxNumber() {
        return BoxNumber;
    }

    public void setBoxNumber(int boxNumber) {
        BoxNumber = boxNumber;
    }

    @JsonProperty("MinPackingNumber")
    public int getMinPackingNumber() {
        return MinPackingNumber;
    }

    public void setMinPackingNumber(int minPackingNumber) {
        MinPackingNumber = minPackingNumber;
    }

    @JsonProperty("MixMaterial")
    public int getMixMaterial() {
        return MixMaterial;
    }

    public void setMixMaterial(int mixMaterial) {
        MixMaterial = mixMaterial;
    }

    @JsonProperty("MixBatch")
    public int getMixBatch() {
        return MixBatch;
    }

    public void setMixBatch(int mixBatch) {
        MixBatch = mixBatch;
    }

    @JsonProperty("ContainerMode")
    public int getContainerMode() {
        return ContainerMode;
    }

    public void setContainerMode(int containerMode) {
        ContainerMode = containerMode;
    }

    @JsonProperty("PickingMode")
    public int getPickingMode() {
        return PickingMode;
    }

    public void setPickingMode(int pickingMode) {
        PickingMode = pickingMode;
    }

    @JsonProperty("PositionX")
    public double getPositionX() {
        return PositionX;
    }

    public void setPositionX(double positionX) {
        PositionX = positionX;
    }

    @JsonProperty("PositionY")
    public double getPositionY() {
        return PositionY;
    }

    public void setPositionY(double positionY) {
        PositionY = positionY;
    }

    @JsonProperty("PositionZ")
    public double getPositionZ() {
        return PositionZ;
    }

    public void setPositionZ(double positionZ) {
        PositionZ = positionZ;
    }

    @JsonProperty("PackSourceCPFR")
    public int getPackSourceCPFR() {
        return PackSourceCPFR;
    }

    public void setPackSourceCPFR(int packSourceCPFR) {
        PackSourceCPFR = packSourceCPFR;
    }

    @JsonProperty("PieceSourceCPFR")
    public int getPieceSourceCPFR() {
        return PieceSourceCPFR;
    }

    public void setPieceSourceCPFR(int pieceSourceCPFR) {
        PieceSourceCPFR = pieceSourceCPFR;
    }
}
